// hyb_yl/mysubpages/pages/capitacenter/capitacenter.js
var app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    capitalist: [
      { "icon": 'https://7969-yiliao-kvepb-1302281264.tcb.qcloud.la/capita1.png?sign=ecad7b40431de1bc88fe409bb66594d6&t=1593508756', "text": '问诊明细' },
      { "icon": 'https://7969-yiliao-kvepb-1302281264.tcb.qcloud.la/capita2.png?sign=5dd7789660fe6834ecd1abeb211fca04&t=1593508764', "text": '年卡明细' },
      { "icon": 'https://7969-yiliao-kvepb-1302281264.tcb.qcloud.la/capita3.png?sign=63f27d0f860fa5a56c4534887c0f18dd&t=1593508771', "text": '挂号明细' },
      { "icon": 'https://7969-yiliao-kvepb-1302281264.tcb.qcloud.la/capita4.png?sign=0f2fe56f8d0fe60214fa9fe628c34d40&t=1593508779', "text": '解读明细' },
      { "icon": 'https://7969-yiliao-kvepb-1302281264.tcb.qcloud.la/capita5.png?sign=7e743660dcbe972e5fd3281aa85d6cc5&t=1593508786', "text": '手术明细' },
      { "icon": 'https://7969-yiliao-kvepb-1302281264.tcb.qcloud.la/capita6.png?sign=97e6d72a225d15849978c47c1da69b21&t=1593508796', "text": '签约明细' },
      { "icon": 'https://7969-yiliao-kvepb-1302281264.tcb.qcloud.la/capita7.png?sign=5ab8ba2ad2b6e94f49094cef4671502c&t=1593508816', "text": '开药明细' },
      { "icon": 'https://7969-yiliao-kvepb-1302281264.tcb.qcloud.la/capita8.png?sign=059471e2b90f2c130fe9b6d57286cf99&t=1593508823', "text": '入驻明细' },
    ]
  },
  capitainfor: function (e) {
    console.log(e);
    var title = e.currentTarget.dataset.title;
    var keyword = e.currentTarget.dataset.keyword;
    wx.navigateTo({
      url: '/hyb_yl/mysubpages/pages/capitadetail/capitadetail?title='+title+'&keyword='+keyword+'&zid='+this.data.zid,
    })

  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    that.setData({
      zid:options.zid
    })
    app.util.request({
      'url':"entry/wxapp/zhuanjia.money_center",
      data:{
        openid:wx.getStorageSync('openid'),
      },
      success:function(res){
        that.setData({
          info:res.data
        })
      }
    })
    app.util.request({
      'url':"entry/wxapp/zhuanjia.server",
      data:{
        zid:options.zid,
      },
      success:function(res){
        that.setData({
          capitalist:res.data
        })
      }
    })
  },
  tixian:function(e){
    var that = this
    var advertisement = that.data.info.info.advertisement;
    var sfzimgurl1back = that.data.info.info.sfzimgurl1back;
    var sfzimgurl2back = that.data.info.info.sfzimgurl2back;
    var zgzimgurl1back = that.data.info.info.zgzimgurl1back;
    var zmoney = parseFloat(e.currentTarget.dataset.zmoney)
    var zid = that.data.zid
    if(advertisement == '' || sfzimgurl1back == '' || sfzimgurl2back == '' || zgzimgurl1back == '')
    {
      wx.showModal({
        title: '提示',
        content:"请先完善信息",
        success:function(con){
          if(con.confirm)
          {
            wx.navigateTo({
              url: '/hyb_yl/backstageOther/pages/myRenZheng/myRenZheng?zid='+zid,
            })
          }
        }
      })
    }else{
      wx.navigateTo({
        url: '/hyb_yl/twosubpages/pages/my_ti/my_ti?zmoney=' + zmoney + '&zid=' + zid,
      })
    }
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})